---
title: "timestamp_column"
sidebarTitle: "timestamp_column"
---

`timestamp_column: [column name]`

<Tip>
  If your data set has a timestamp column that represents the creation time of a
  field, it is highly recommended configuring it as a `timestamp_column`.
</Tip>

Elementary anomaly detection tests will use this column to create time buckets and filter the table.
It is highly recommended to configure a timestamp column (if there is one).
The best column for this would be an `updated_at`/`created_at`/`loaded_at` timestamp for each row (date type also works).

- When you specify a `timestamp_column`, when the test runs it splits the data to buckets according to the timestamp in this column, calculates the metric for each bucket and checks for anomalies between these buckets.
  This also means that if the table has enough historical data, the test can start working right away.
- When you do not specify a `timestamp_column`, each time the test runs it calculates the metric for all of the data in the table, and checks for anomalies between the metric from previous runs.
  This also means that it will take the test `training_period` days to start working, as it needs to the time to collect the necessary metrics.

If undefined, default is null (no time buckets).

- _Default: none_
- _Relevant tests: All anomaly detection tests_

<RequestExample>

```yml test
models:
  - name: this_is_a_model
    tests:
      - elementary.volume_anomalies:
          timestamp_column: created_at
```

```yml model
models:
  - name: this_is_a_model
    config:
      elementary:
        timestamp_column: updated_at
```

```yml source
sources:
  - name: my_non_dbt_tables
    schema: raw
    tables:
      - name: source_table
        meta:
          elementary:
            timestamp_column: loaded_at
```

```yml dbt_project.yml
vars:
  timestamp_column: loaded_at
```

</RequestExample>
